package op;

public class Test7 {

	public static void main(String[] args) {
		/*
		//1
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 5; j++) {
				System.out.print("*");
			}
			System.out.println();
		}
		
		
		for (int i = 6; i > 0; i--) {
			for (int j = 0; j < i ; j++) {
				System.out.print("*");
			} 
			System.out.println();
		}
		
		
		for (int i = 1; i<=5; i++) {
			//空格
			for (int k = 0; k < 5-i; k++) {
				System.out.print(" ");
			}
			
			for (int j = 0; j < 2*i-1 ; j++) {
				System.out.print("*");
			} 
			System.out.println();
		}
		*/
		
		
		// 菱形
		for (int i = -4; i<=4; i++) {
			int jdz= i<0?-i:i; //求绝对值
			//空格
			for (int k = 0; k < jdz; k++) {
				System.out.print(" ");
			}
			
			for (int j = 0; j < 9-2*jdz ; j++) {
				if (j==0 || j==9-2*jdz-1) {
					System.out.print("*");
				}else {
					System.out.print(" ");
				}
				
			} 
			System.out.println();
		}
	}

}
